package javabase.base.client10.deep;

/**
 * @author chengshuai
 * @date 2021/5/2 13:05
 */

import lombok.AllArgsConstructor;
import lombok.Data;

import java.io.Serializable;

/**
 * 用户
 */
@Data
@AllArgsConstructor
public class User implements Serializable ,Cloneable {
    private String name;
    private Address address;

    @Override
    public User clone() throws CloneNotSupportedException {
        User user = (User) super.clone();
        user.setAddress(this.address.clone());
        return user;
    }
}